package com.itheima.d11_serializable.entity;

import java.io.Serializable;

/**
 * 实体类：存储账户信息
 */
public class Account  implements Serializable {

    private String cardId;//卡号
    private String username;//用户名
    private String password;//密码
    private String sex; // 性别
    private double money;// 余额
    private double limit;// 单次取现额度

    public Account() {
    }

    public Account(String cardId, String username, String password, String sex, double money, double limit) {
        this.cardId = cardId;
        this.username = username;
        this.password = password;
        this.sex = sex;
        this.money = money;
        this.limit = limit;
    }

    @Override
    public String toString() {
        return "Account{" +
                "cardId='" + cardId + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", sex='" + sex + '\'' +
                ", money=" + money +
                ", limit=" + limit +
                '}';
    }

    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    public String getUsername() {
        // 根据性别返回
        if(sex.equals("男")){
            return username+"先生";
        }else{
            return username+"女生";
        }
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public double getLimit() {
        return limit;
    }

    public void setLimit(double limit) {
        this.limit = limit;
    }
}
